<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="/editormd/css/editormd.css" />
</head>
<body>


<form class="layui-form"> <!--class="layui-form"-->
    <div class="layui-form-item">
        <label class="layui-form-label">文章标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" lay-verify="required" lay-reqtext="请输入文章标题" placeholder="请输入文章标题..." autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">文章分类</label>
        <div class="layui-input-block" id="js-blog-typeId">
            <!--文章分类-->
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">博客标签</label>
        <div class="layui-input-block" id="js-blog-tagId" lay-verify-msg="请选择标签" lay-verify="mustcheck">
            <!--博客标签-->
        </div>
    </div>

    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">文章内容</label>
        <div class="layui-input-block" id="blog-editor">
            <textarea placeholder="请输入内容" class="layui-textarea" lay-verify="required" name="blogContent"></textarea>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" name="coverPhoto" lay-verify="required" lay-reqtext="请上传封面照片" />
            <img src="" id="blog-coverPhoto" style="width:50px;height: 50px;"/>
            <button class="layui-btn coverPhoto"  type="button" lay-data="{url: '/file/uploadImage/'}">封面照片</button>
        </div>
    </div>


    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" id="js-blog-content" lay-filter="blog">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>


</form>


<script src="/layui/layui.js" charset="utf-8"></script>
<script src="/js/jquery-3.2.1.min.js" charset="utf-8"></script>
<script src="/editormd/editormd.min.js"></script>
<script src="/js/uploadImg.js"></script>
<script src="/js/global.js"></script>
<script src="/lib/aes.min.js"></script>
<script src="/js/editBlog.js"></script>
<script src="/js/main.js"></script>
<script>
    //初始化分类信息
    queryType();
    //初始化标签信息
    queryTag();
    //详情查询
    queryBlogDetail(getReqUrl('id'));
</script>
</body>
</html>